#ifndef __SystemVector_h
#define __SystemVector_h

#include  "coefvector.h"

/*----------------------------------------------------------*/

class SystemVector : public std::vector<CoefVector>
{
public:
  SystemVector(int ncomp, int degre) : std::vector<CoefVector>(ncomp, degre) {}
  int ncomp() const
  {
    return std::vector<CoefVector>::size();
  }
  const CoefVector& operator()(int icomp) const
  {
    return ( *this )[icomp];
  }
  CoefVector& operator()(int icomp)
  {
    return ( *this )[icomp];
  }
  void reSize(size_t n)
  {
    for(int icomp = 0; icomp < ncomp(); icomp++)
    {
      ( *this )( icomp ).reSize(n);
    }
  }
  void zero()
  {
    for(int icomp = 0; icomp < ncomp(); icomp++)
    {
      ( *this )( icomp ).zero();
    }
  }

  friend std::ostream& operator<<(std::ostream& s, const SystemVector& A)
  {
    for(int icomp = 0; icomp < A.ncomp(); icomp++)
    {
      s << A(icomp) << "\n";
    }
    return s;
  }
};

#endif
